// 通用响应类型
export interface ResponseType {
  code: number;
  message: string;
  ok: boolean;
}

// 用户类型(展示和新增)
export interface UserType {
  id?: number | string;
  createTime?: string;
  updateTime?: string;
  username?: string;
  password?: string;
  name?: string | undefined;
  phone?: number | string | undefined;
  roleName?: string;
}

// 用户列表
export type UserListType = UserType[];

// 用户列表数据类型
export interface UserListData {
  records: UserType[];
  total: number;
  size: number;
  current: number;
  orders: any[];
  optimizeCountSql: boolean;
  hitCount: boolean;
  countId: any;
  maxLimit: any;
  searchCount: boolean;
  pages: number;
}

// 用户列表响应类型
export interface UserListResponseType extends ResponseType {
  data: UserListData;
}

// 角色类型
export interface RoleData {
  id: number | string;
  createTime: string;
  updateTime: string;
  roleName: string;
  remark: string;
}

// 角色列表类型
export type RoleListType = RoleData[];

// 角色列表响应类型
export interface RoleListResponseType extends ResponseType {
  data: {
    assignRoles: RoleListType;
    allRolesList: RoleListType;
  };
}

// 保存用户角色的参数类型
export interface UserAssignRoleParamsType {
  userId: string | number;
  roleIdList: number[];
}
